function foo1(name: string): number {
    return name.length
}

console.log(foo1('asfd'));
const foo2: (name: string) => number = function (name) {
    return name.length
}
const foo3 = (name: string): number => {
    return name.length
}

// 方式二
const foo: (name: string) => number = (name) => {
    return name.length
}
// 方式二可读性更高得办法
type FuncFoo = (name: string) => number

const foo4: FuncFoo = (name) => {
    return name.length
}
// declare const foo5: {
//     func?: () => ({
//         prop?: number | null;
//     })
// };
// console.log(foo5);

// foo5.func!().prop!.toFixed();
export { }